<script src="web/assets/plugins/bootstrap-select2/select2.min.js" type="text/javascript"></script>
<script src="web/assets/plugins/jquery-datatable/js/jquery.dataTables.min.js" type="text/javascript" ></script>
<script src="web/assets/js/table_configuracion.js" type="text/javascript"></script>
<script src="./fuentes/view/pokerTorneo/js/script_ajax_poker_torneo.js" type="text/javascript"></script>


<!-- Modal -->
<div class="modal fade" id="myModalPokerTorneoADD" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myModalLabel" class="semi-bold">Torneos</h4>
            </div>

            <div class="modal-body">
                <form  action="./fuentes/controller/PokerTorneo.php" id="formPokerTorneo" name="formPokerTorneo" autocomplete="off" > 
                    <?php require_once '/FormPokerTorneo.php'; ?>
                </form>    
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
</div>



<div class="clearfix"></div>
<div class="content">  
    <div class="row" id="movimiento">
        <div class="col-md-12">
            <div class="grid simple ">
                <div class="grid-title no-border">
                    <h4><span class="semi-bold"> Lista de Torneos </span>
                    </h4>
                    <button style="float: right;" class="btn btn-success btn-xs " id="agregar" data-toggle="modal"  data-target="#myModalPokerTorneoADD"> Agregar</button>
                    <div class="labelRight" id="error">	

                    </div>
                </div>
                <div class="grid-body no-border">
                    <table class="table table-hover no-more-tables table-condensed  " id="pokerTorneoTABLE">
                        <thead>
                            <tr>
                                <th style="width:1%">ID</th>
                                <th style="width:15%">Nombre </th>
                                <th class='text-center' style="width:6%">Fecha</th>

                                <th class="text-right"style="width:4%">Pozo</th>
                                <th class="text-right"style="width:4%">Puntos</th>
                                <th class="text-center"  style="width:7%">Accion</th>


                            </tr>
                        </thead>
                        <tbody id="pokerTorneoList">

                            <?php
                            if ($pokerTorneos) {
                                foreach ($pokerTorneos as $dato) {
                                    echo "<tr >";
                                    echo "<td>" . $dato["id"] . "</td>";
                                    echo "<td>" . $dato["nombre"] . "</td>";
                                    echo "<td class='text-center'>" . date("d/m/Y", strtotime($dato["fecha"])) . "</td>";
                                    echo "<td class='text-right'>"  . $dato["moneda"] . " " . number_format($dato["pozo_acumulado"], 2, ',', '.') . "</td>";
                                    echo "<td class='text-right'>" . number_format($dato["total_puntos"], 0, ',', '.') . "</td>";
                                    echo "<td>";
                                    echo "<button class='btn btn-success btn-xs btn-mini' onclick='editDatos(" . $dato["id"] . ")' title='Editar' ><i class='fa fa-pencil'></i></button>";
                                    echo "&nbsp;&nbsp; ";
                                    echo "<button class='btn btn-success btn-xs btn-mini' onclick='eliminarDato(" . $dato["id"] . ")'  title='Eliminar' ><i class='fa fa-times'></i></button>";
                                    echo "&nbsp;&nbsp; ";
                                    echo " <a class='btn btn-success btn-xs btn-mini dropdown-toggle ' data-toggle='dropdown' href='javascript:void(0)'> <i class='fa fa-cogs'></i> <span class='caret'></span> </a>
                                            <ul class='dropdown-menu'>
                                              <li><a href='javascript:void(0)' onclick='opcionesPokerTorneo(" . $dato["id"] . ",3)'>Asignaciones</a></li>
                                              <li><a href='javascript:void(0)' onclick='opcionesPokerTorneo(" . $dato["id"] . ",2)'>Pay Out</a></li>
                                            </ul>";
                                    echo "</td>";
                                    echo "</tr>";
                                }
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>



    <!-- END PAGE --> 


</div>




